Repository navigation
fix: restore react compiler and stop history modal render loop - #128
Merged
Merged
Conversation
@vitejs/plugin-react v6 dropped the `babel` option, so the React Compiler config in vite.config.ts was silently ignored after the Vite 8 upgrade. Without memoization, the history modal's open effect depended on a `refresh` function recreated every render and looped until React hit its update depth limit, leaving "Loading tasks…" on screen. - Run the compiler through @rolldown/plugin-babel with reactCompilerPreset. Pin @babel/core to v7: under Babel 8, babel-plugin-react-compiler 1.0.0 skips components with destructured prop defaults. - Reload history data inside useHistoryData, keyed on isOpen only, so the modal no longer depends on refresh's identity.
Deploying ephe with
|
| Latest commit: |
bbb5b9f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ea3a36e0.ephe.pages.dev |
| Branch Preview URL: | https://fix-react-compiler-history-m.ephe.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since the Vite 8 upgrade (f0a07ed), React Compiler has not run:
@vitejs/plugin-reactv6 dropped thebabeloption, so the config was silently ignored. Without memoization, the history modal's open effect depended on arefreshrecreated every render and looped until React hit "Maximum update depth exceeded", leaving "Loading tasks…" on screen.@rolldown/plugin-babelwithreactCompilerPreset(); add@rolldown/plugin-babel,@babel/core,@types/babel__core@babel/coreto v7: under Babel 8,babel-plugin-react-compiler1.0.0 skips any component with destructured prop defaults (e.g.HistoryModal)useHistoryData(isOpen), keyed onisOpenonly; droprefreshfrom the hook and the modalValidation:
tsc,pnpm lint,vitest run src(157 passed),vite build. In the dev server with 61 completed tasks, the Tasks tab renders in ~16 ms with no console errors (before: stuck on "Loading tasks…" with 377 update-depth errors), and a task added while the modal is closed shows on reopen. Servedhistory-modal.tsx,use-history-data.ts, and the menu modules include the compiler runtime.Still skipped by the compiler, unchanged here:
editor-page.tsx(ref read during render),codemirror-editor.tsxandmulti-editor.tsx(getter in an object literal),use-document-picture-in-picture.ts(try…finally).